package com.example.test_003;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import ognl.Ognl;
import ognl.OgnlException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class JunitOgnlExample {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testSetValue() throws OgnlException {
		ValueBean bean  = new ValueBean();
		bean.setAge("100");
		bean.setName("Testing");
		
		CompoundRoot lst =  new CompoundRoot();
		lst.add(bean);
		Map map = new HashMap();
		map.put("name", "aaValue");
		Ognl.setValue("name", map, lst, "value...............");
		System.out.println(map);
		System.out.println(lst);
	}

}
